package olga.gorbatiuk.perdep.entity;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Olga Gorbatiuk
 */
@XmlRootElement
public class Project implements Serializable {

    private static final long serialVersionUID = 1L;
    private Integer projectId;
    private String name;
    private List<Employee> employeeList;
    private Customer customerId;

    public Project() {
    }

    public Project(Integer projectId) {
        this.projectId = projectId;
    }

    public Project(Integer projectId, String name) {
        this.projectId = projectId;
        this.name = name;
    }

    public Integer getProjectId() {
        return projectId;
    }

    public void setProjectId(Integer projectId) {
        this.projectId = projectId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @XmlTransient
    public List<Employee> getEmployeeList() {
        return employeeList;
    }

    public void setEmployeeList(List<Employee> employeeList) {
        this.employeeList = employeeList;
    }

    public Customer getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Customer customerId) {
        this.customerId = customerId;
    }

    @Override
    public final int hashCode() {
        return Objects.hashCode(this.name);
    }

    @Override
    public final boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (!(object instanceof Project)) {
            return false;
        }
        final Project other = (Project) object;
        return Objects.equals(this.name, other.name);
    }

    @Override
    public String toString() {
        return "olga.gorbatiuk.perdep.entity.Project[ projectId=" + projectId + " ]";
    }

}
